<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta content="width=device-width,initial-scale=1,maximum-scale=1, user-scalable=no" name="viewport"/>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
 	<link href="css/crm-min.va8b8cfff.css" rel="stylesheet"/>
 	<link href="css/cs.css" rel="stylesheet"/>
 	<link href="css/ds.css" rel="stylesheet"/>
 	<link href="css/es.css" rel="stylesheet"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>卖家主页</title>
	<script src="js/jquery-1.12.0.min.js"></script>
	
	<script type="text/javascript">
		
	
	
	</script>
	 
 

   
</head>
<body>

<div id="add-business-opportunity">
<div class="hdw"></div>
<header id="site-mast"  class="site-mast" >
<!--左侧菜单  -->
<div class="site-mast__site-nav-w">
	<div class="site-mast__site-nav">
		<div  class="site-mast__site-nav-inner" >
			<div data-component="cate-nav" class="component-cate-nav" mt-scope='[]'  data-component-config='{"lazyRender":false}'><img src='data:image/png,' onerror='M._autoinit.push(this.parentNode);this.parentNode.removeChild(this);' width=1 height=1 style='position:absolute;'>
				<span class="mt-cates J-nav__trigger">主页</span>
					
				<div class="cate-nav J-nav__list J-nav__list--present cateNavNew" data-mtnode="Acategory.Enavcategory"  data-mod="nc" >
					<div class="J-nav-item">
					    <div class="cate-nav__item J-cate-nav__item--1 cate-nav__item--1 cate-nav__item--has-l2 "  data-mtnode="Bmeishi">
					        <div  class="nav-level1 nav-level1--first" id="my_item0">
					            <dl >
					                <dt><a class="nav-level1__label" >商店信息</a> </dt>
					            </dl>
					            
					        </div>
					    </div>
					</div>
					<div class="J-nav-item">
					    <div class="cate-nav__item J-cate-nav__item--1 cate-nav__item--1 cate-nav__item--has-l2 "  data-mtnode="Bmeishi">
					        <div  class="nav-level1 " id="my_item1">
					            <dl >
					                <dt><a class="nav-level1__label" id="my_shangpin">我的商品</a> </dt>
					            	
					            </dl>
					             
					        </div>
					    </div>
					</div>
					<div class="J-nav-item">
					    <div class="cate-nav__item J-cate-nav__item--20 cate-nav__item--20 cate-nav__item--has-l2 "  data-mtnode="Bjiudian">
					        <div  class="nav-level1" id="my_item2">
					            <dl >
					                <dt><a class="nav-level1__label " hidefocus="true" > 我的订单</a> </dt>
					                <dd class="nav-level1__item"><a href="http://hotel.meituan.com/beijing/c-jingjijiudian"  data-mttcode="Cjingjijiudian"  gaevent="nav/category/jingjijiudian">经济型酒店q</a></dd>
					            <dd class="nav-level1__item"><a href="http://hotel.meituan.com/beijing/c-jingjijiudian"  data-mttcode="Cjingjijiudian"  gaevent="nav/category/jingjijiudian">经济型酒店q</a></dd>
					            
								</dl>					           
					        </div>
					    </div>
					</div>
					<div class="J-nav-item">
					    <div class="cate-nav__item J-cate-nav__item--99 cate-nav__item--99 cate-nav__item--has-l2 "  data-mtnode="Bdianying">
					        <div  class="nav-level1" id="my_item3">
					            <dl >
					                <dt><a class="nav-level1__label"  hidefocus="true" > 我的评价</a> </dt>
					            </dl>
					           
					        </div>
					    </div>
					</div>
					<div class="J-nav-item">
					    <div class="cate-nav__item J-cate-nav__item--10 cate-nav__item--10 cate-nav__item--no-l2 "  data-mtnode="Cpc_ktv">
					        <div  class="nav-level1" id="my_item4">
					            <dl >
					                <dt><a class="nav-level1__label" hidefocus="true" > 我的营业额</a> </dt>
					            </dl>
					        </div>
					    </div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</header>

<!--主显示区  --> 
<div id="bdw" class="bdw">
    <div id="bd" class="cf">
		<noscript hidden style="display:none;"  data-comboajax-uri='/index/tips/index/floornewV2' data-comboajax-onsuccess='$request.listen("www-tips", "www.Tips");' data-comboajax-data='{"sysmsg":true,"commontips":true,"page":"index"}' data-comboajax-state='0' data-parent="body"></noscript>
		
		<div class="content">
		    <div class="content__header">
		        <!-- 首屏 -->
		        <div data-component="floor-fsnew" class="component-floor-fsnew" mt-scope='[]'  data-component-config='{"lazyRender":false}'><img src='data:image/png,' onerror='M._autoinit.push(this.parentNode);this.parentNode.removeChild(this);' width=1 height=1 style='position:absolute;'>
			        <div class="floor-fsnew cf">
				    	<div class="fs site-fs J-site-fs__content">
				 
							<div class="floor-fs-new__activity">
							    <div class="promotion"  data-mod="ip" data-mod-selector=".left,.right">
							        <ul class="promotion__slider J-promotion__slider cf">
							            <li class="sheet" style="display:none" id="storeInfo">
							                        <div id="add-business-opportunity">
													    <div class="infos clearfix">
													        <div class="boform-info">
													        <div class="mainbox">
													            <div class="content">
													            <div class="title-tip">个人信息</div>
													            <div class="navbar-container category clearfix">
													                
													            </div>
													            <form id="feedback-form" class="common-form" method="post" action="/register">
													                <input type="hidden" id="J-pic-key" name="licenseFileKey" value="${loginUser.id}"/>
													                <div class="field-group">
													                    <label class="field-item" for="fullname">您的姓名</label>
													                    <input  name="sellerName" autofocus autocomplete="off"  tabindex="1" id="fullname"  class="f-text smiddle-text user-name"  value="${loginUser.sellerName }"/>
													                </div>
													                <div class="field-group">
													                    <label class="field-item" for="number">联系方式</label>
													                    <input name="mobile"  autocomplete="off" tabindex="2" id="number" class="f-text smiddle-text mobile"  value="${loginUser.mobile}"/>
													                </div>
													                <div class="field-group">
													                    <label class="field-item" for="email">邮箱</label>
													                    <input name="email"  autocomplete="off" tabindex="3"  id="email" class="f-text smiddle-text email" value="${loginUser.email}"/>
													                </div>
													                <div class="field-group">
													                    <label class="field-item" for="contacts">其他联系方式</label>
													                    <input name="qq" id="contacts" class="f-text smiddle-text" autocomplete="off" tabindex="4"  value="${loginUser.qq}"/>
													                </div>
													
													 
													                <div class="field-group">
													                    <label class="field-item" for="category">商家类型</label>
													                    <div class="relative">
													                      <input type="text"  class="f-text smiddle-text cat-name"  id="category"  name="type" autocomplete="off" tabindex="12" value="${loginUser.type}"/>
													                    </div>
													                </div>
													                <hr/>
													                <div class="field-group">
													                    <label class="field-item" for="feedback-bizname">门店名称</label>
													                    <input type="text" maxlength="100" name="shopName"  id="feedback-bizname" tabindex="5" autocomplete="off" class="f-text smiddle-text branch-name" value="${loginUser.shopName}"/>
													                </div>
													                <div class="field-group">
													                    <label class="field-item" for="feedback-city">城市</label>
													                    <span>
													                        <input type="text" class="f-text short-text city-name" autocomplete="off" name="city" tabindex="6" id="feedback-city" value="${loginUser.address.city}"/>
													                    </span>
													               </div>
													               <div class="field-group">
													                    <label class="field-item">区域</label>
													                     <input type="text" class="f-text short-text district-name"  autocomplete="off" tabindex="6" name="town" value="${loginUser.address.street}"/>
													                      
													                   
													             </div>
													               <div class="field-group"> 
													                    <label class="field-item" for="feedback-detailAddress">详细地址</label>
													                    <input type="text" name="details" id="feedback-detailAddress" class="f-text smiddle-text" autocomplete="off" tabindex="10" value="${loginUser.details}"/>
													               </div>
													               <div class="field-group">
													                    <label class="field-item" for="branch-phone">门店电话</label>
													                    <input type="text" name="tele" id="branch-phone" class="f-text smiddle-text" autocomplete="off" tabindex="10" value="${loginUser.tele}"/>
													 				</div>
													            </form>
													            
													        	</div>
													
													    	</div>
															</div>
														</div>
													</div>
							            </li>
							             <li class="sheet" style="display:none" id="goodsInfo">
							                        <div id="goods_detail_show" >
														<table width="100%" border="1" class="order_detail_table" >
														<tr><td  colspan="10"><font size="5" color="black">我的商品&nbsp;</font><input type="button" value="上架新商品" id="goods_item_insert" /></td></tr>
														<tr>
															<th width="4%"></th>
															<th width="9%">商品编号</th>
															<th width="9%">商品名称</th>
															<th width="9%">商品图片</th>
															<th width="9%">商品价格</th>
															<th width="9%">商品类型</th>
															<th width="9%">商品折扣</th>
															<th width="9%">商品数量</th>
															<th width="14 %">优惠备注</th>
															<th width="9%">操作</th>
														</tr>
														</table>
														<table  width="100%" border="1" class="order_detail_table"  id="goods_detail_item">
														</table>							                        
							                        </div>
							                        <div id="add-business-opportunity" style="display:none" >
													    <div class="boform-info">
													        <div class="mainbox">
													            <div class="content">
														       		<div class="title-tip">请填写商品信息</div>
														            <form id="feedback-form" class="common-form" method="post" action="/insertGoods">
														                <input type="hidden" id="goods_item_add_id" name="sellId" value="${loginUser.id}"/>
														                <div class="field-group">
														                    <label class="field-item" for="commodityCode"><em class="required">*</em>商品编号</label>
														                    <input  name="commodityCode" autofocus autocomplete="off" data-tips="请填写商品名称" tabindex="1" id="Goodname"  class="f-text smiddle-text user-name"  value=""/>
														                </div>
														                <div class="field-group">
														                    <label class="field-item" for="commodityName"><em class="required">*</em>商品名称</label>
														                    <input  name="commodityName" autofocus autocomplete="off" data-tips="请填写商品名称" tabindex="1" id="Goodname"  class="f-text smiddle-text user-name"  value=""/>
														                </div>
														                <div class="field-group">
														                    <label class="field-item" for="commodityType">商品种类</label>
														                    <input name="commodityType" data-tips="请填写商品种类" autocomplete="off" tabindex="2" id="number" class="f-text smiddle-text mobile"  value=""/>
														                </div>
														                <div class="field-group">
														                    <label class="field-item" for="commodityPrice">商品价格</label>
														                    <input name="commodityPrice" data-tips="请填写商品价格" autocomplete="off" tabindex="3"  id="email" class="f-text smiddle-text email" value=""/>
														                </div>
														                <div class="field-group">
														                    <label class="field-item" for="commodityPicture">商品图片</label>
														                    <input name="commodityPicture"  class="f-text smiddle-text" autocomplete="off" tabindex="4" value=""/>
														                </div>
														                <div class="field-group">
														                    <label class="field-item" for="commodityDiscount">商品折扣</label>
														                    <input name="commodityDiscount" class="f-text smiddle-text" autocomplete="off" tabindex="4"  value=""/>
														                </div>
														                <div class="field-group">
														                    <label class="field-item" for="commodiryNum">商品库存量</label>
														                    <input name="commodiryNum" class="f-text smiddle-text" autocomplete="off" tabindex="4"  value=""/>
														                </div>
														                <div class="field-group">
														                    <label class="field-item" for="commodityTip">商品描述</label>
														                    <textarea name="commodityTip" maxlength="250" data-tips="请填写商品描述" tabindex="9" class="address" id="feedback-detailAddress" ></textarea>                   
														                </div>
														   
														            </form>
														        </div>
													   		</div>
														</div>
													</div>
																				                        
							            </li>
							            <li class="sheet" style=" display:none " id="orderSum">
							                        <div  class="left choice__item" >
							                            
							                        </div>
							                        
							            </li>
							            <li class="sheet" style=" display:none " id="pingJia">
							                        <div  class="left choice__item" >
							                        </div>
							                        
							            </li>
							            <li class="sheet" style=" display:none " id="yingYeE">
							                        <div  class="left choice__item" >
							                           
							                        </div>
							                      
							            </li>
							            <li class="sheet" style=" display:none ">
							                        <div  class="left choice__item" >
							                          
							                        </div>
							                     
							            </li>
							            <li class="sheet" style=" display:none ">
							                        <div  class="left choice__item" >
							                         
							                        </div>
							                   
							            </li>
							        </ul>
							       
							    </div>
							</div>
						</div>
					</div>
				</div>
			</div>

		</div>
	</div>
</div>


    
    
</div>
 
<script src="js/action.js"></script>
<script type="text/javascript" >
	$("#my_shangpin").click(function(){
		var store_id=$("#J-pic-key").val();
		
		$.ajax({
			  type: "POST",
			  url: "queryAllGoods",
			  data:{'store_id':store_id},
			  dataType: "json", //指定返回数据类型
			  success: function(data){
				  $("table#goods_detail_item ").empty();
				  jQuery.each(data, function(i,item){   
					  
		               // alert(item.commodityCode+","+item.commodityName+","+item.commodityPicture+","+item.commodityPrice+","+item.commodityType+",+"+item.commodityDiscount+","+item.commodiryNum+","+item.commodityTip);   
		            	
		                $("table#goods_detail_item ").append(
							"<tr><td width='4%'>"+item.commodityId
							+"</td><td width='9%'>"+item.commodityCode
	                		+"</td><td width='9%'>"+item.commodityName
	                		+"</td><td width='9%'>"+item.commodityPicture
	                		+"</td><td width='9%'>"+item.commodityPrice
	                		+"</td><td width='9%'>"+item.commodityType
	                		+"</td><td width='9%'>"+item.commodityDiscount
	                		+"</td><td width='9%'>"+item.commodiryNum
	                		+"</td><td width='14%'>"+item.commodityTip
	                		+"</td><td width='9%'><input type='button' value='修改' id='update_item' /><input type='button' value='删除' id='delete_item' /></td></tr>");
	            });  

					
			     
			  },
			  error:function(){
				  alert("error");
			  }
			});
		
	});
	$("#goods_item_insert").click(function(){
		$("#goods_detail_show").hide();
		$("#add-business-opportunity").show();
	});
	/* $("#goods_item_insert_button").click(function(){
		$.ajax({
			type: "POST",
			url: "queryAllGoods",
			data:{'store_id':store_id},
			dataType: "json", //指定返回数据类型
			success: function(data){
				
				
			},
			error:function(){
				  
			}
			
		});
	}); */
	

</script>	
</body>
</html>
